
import matplotlib.pyplot as plt
import re




data = [None]*5
start = 14
data[0]=[18, 21, 8, 16, 6, 14, 19, 16, 17, 10, 20, 18, 13, 11, 18, 17, 17, 10, 14, 18]
data[1]=[20, 16, 14, 35, 27, 38, 24, 35, 27, 32]
data[2]=[28, 9, 37, 33, 29, 44, 44]
data[3]=[36, 35, 50, 33, 42]
data[4]=[37, 34, 38, 36]

colors = ["#FF8C69","#EEB422","#DDA0DD","#CAFF70","#9F79EE"]

for i in range(0,5):
	d= data[i]
	step = i+1
	x = range(1,1+len(d)*step+step,step)
	y = [start+sum(d[:k]) for k in range(1,len(d)+1)]
	y.insert(0,start)
	if step == 1:
		la = "no merge"
	else:
		la = "merge num = %d"%step
	plt.plot(x,y,'-*',label=la)
plt.legend()
plt.savefig("figs/merge.png")
plt.show()
